const Mock= require('mockjs');
const getQuestionList = require('./data/getQuestionList');

const Random= Mock.Random;

module.exports=[
    {
        url: '/api/question/:id',
        method: 'get',
        response() {
            return {
                errno: 0,
                data: {
                    id: Random.id(),
                    title: Random.ctitle(),
                    componentList:[
                        // Title
                        {
                            fe_id: Random.id(),
                            type:'questionTitle',
                            title: '标题',
                            props: { text:'个人信息调研',level:1,isCenter:false}
                        },
                        // Input
                        {
                            fe_id: Random.id(),
                            type: 'questionInput',
                            title: '输入框1',
                            props:{title:"输入姓名",placeholder:"请输入姓名..."}
                        },
                        {
                            fe_id: Random.id(),
                            type: 'questionInput',
                            title: '输入框2',
                            props:{title:"输入电话",placeholder:"请输入电话..."}
                        }
                    ]
                }
            }
        }
    },
    {
        url: '/api/question',
        method: 'post',
        response() {
            return {
                errno: 0,
                data: {
                    id: Random.id(),
                }
            }
        }
    },
    {
        url: '/api/question',
        method: 'get',
        response() {
            return {
                errno: 0,
                data: {
                    list:getQuestionList(),
                    total: 100
                }
            }
        }
    }
]